﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=TreeViewEx"
        xmlns:Model="clr-namespace:TreeViewEx.ComplexSample.Model">

    <Style TargetType="{x:Type Controls:TreeViewExItem}" x:Key="nodeBaseStyle">
        <Setter Property="IsVisible" Value="{Binding IsVisible, Mode=TwoWay}" />
        <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
        <Setter Property="IsEditable" Value="{Binding IsEditable, Mode=TwoWay}" />
        <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
    </Style>

    <DataTemplate DataType="{x:Type Model:NodeBase}" x:Key="detailTemplate">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="25"/>
                <RowDefinition Height="25"/>
                <RowDefinition Height="25"/>
                <RowDefinition Height="25"/>
                <RowDefinition Height="25"/>
                <RowDefinition Height="25"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="25"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Label Content="Name"/>
            <Label Content="{Binding Name}" Grid.Column="1" />
            <Label Content="IsSelected" Grid.Row="1" />
            <CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" Grid.Row="1" Grid.Column="1" />
            <Label Content="IsVisible" Grid.Row="2" />
            <CheckBox IsChecked="{Binding IsVisible, Mode=TwoWay}" Grid.Row="2" Grid.Column="1" />
            <Label Content="IsEditable" Grid.Row="3" />
            <CheckBox IsChecked="{Binding IsEditable}" Grid.Row="3" Grid.Column="1" IsEnabled="False" />
            <Label Content="IsExpanded" Grid.Row="4" />
            <CheckBox IsChecked="{Binding IsExpanded}" Grid.Row="4" Grid.Column="1" />
            <Label Content="Tip:" Grid.Row="5" />
            <TextBlock Margin="5" Text="{Binding Tip}" Grid.Row="6" TextWrapping="WrapWithOverflow" Grid.ColumnSpan="2"/>
        </Grid>
    </DataTemplate>

</ResourceDictionary>